package www.wmx.com.xssc.util.enumUtil;

public enum CgjlType {

    JCYJJ(0, "基础研究奖"),
    JSFMJ(1, "技术发明奖"),
    KJJBJ(2, "科技进步奖"),
    YXNTGGJ(3, "一线难题攻关奖");

    private final int code;
    private final String message;

    //构造函数为每个枚举实例赋值
    CgjlType(int code, String message) {
        this.code = code;
        this.message = message;
    }

    // 获取错误代码
    public int getCode() {
        return code;
    }

    // 获取错误信息
    public String getMessage() {
        return message;
    }

    // 根据错误代码获取枚举实例
    public static CgjlType getByCode(int code) {
        for (CgjlType cgjlType : CgjlType.values()) {
            if (cgjlType.getCode() == code) {
                return cgjlType;
            }
        }
        return null;
    }
}
